package com.lv.fast.security;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

/**
 * @author lv
 * @version 1.0.0
 */
@WebFilter(filterName = "xssFilter", urlPatterns = "/*", asyncSupported = true)
public class GlobalSecurityFilter implements Filter {

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        HttpServletRequest httpServletRequest = (HttpServletRequest) request;
        GlobalSecurityHttpServletRequestWrapper globalSecurityHttpServletRequestWrapper = new GlobalSecurityHttpServletRequestWrapper(httpServletRequest);
        chain.doFilter(globalSecurityHttpServletRequestWrapper, response);
    }
}
